home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / pdcurs21.zip / PRIVATE.ZIP / _USLEEP.C < prev    next >
Text File  |  1992-11-21  |  1KB  |  50 lines

  1. #define        CURSES_LIBRARY  1
  2. #include <curses.h>
  3. #undef PDC_usleep
  4.  
  5. #if defined(DOS) && defined(MSC)
  6. #include <time.h>
  7. #endif
  8.  
  9. #ifndef        NDEBUG
  10. char *rcsid__usleep = "$Header: c:/curses/private/RCS/_usleep.c%v 2.0 1992/11/15 03:24:40 MH Rel $";
  11. #endif
  12.  
  13.  
  14.  
  15. /*man-start*********************************************************************
  16.  
  17.   PDC_usleep() - waits for specified number of microseconds
  18.  
  19.   PDCurses Description:
  20.        This routine is intended to provide a mechanism to wait the
  21.        specified number of microseconds. This routine is provided for
  22.        users of the Microsoft compilers under DOS as the default
  23.        library does not provide a suitable function.
  24.        Under any other Operating System/Compiler option, this function
  25.        does nothing.
  26.  
  27.   Portability:
  28.        PDCurses        void PDC_usleep( clock_t );
  29.  
  30.   Acknowledgement
  31.        PDC_usleep() was written by John Steele  (jsteele@netcom.com)
  32.  
  33. **man-end**********************************************************************/
  34.  
  35. #if defined(DOS) && defined(MSC)
  36. void   PDC_usleep(clock_t wait)
  37. {
  38.        clock_t goal;
  39.        goal = wait + clock();
  40.        while (goal > clock())
  41.        ;
  42.        return;
  43. }
  44. #else
  45. void   PDC_usleep(long wait)
  46. {
  47.        return;
  48. }
  49. #endif
  50.